package com.wushijia.test;

/**
 * description:树节点
 *
 * @author yang
 * @date 2019/1/3 17:06
 */
public class Tree {

  private TreeNode root;

  TreeNode getRoot() {
    return root;
  }

  public void setRoot(TreeNode root) {
    this.root = root;
  }

  Tree(TreeNode root) {
    this.root = root;
  }

  static class TreeNode {

    public TreeNode left;
    public TreeNode right;
    private String val;

    String getVal() {
      return val;
    }

    public void setVal(String val) {
      this.val = val;
    }

    TreeNode(String val) {
      this.val = val;
    }

    public void addLeftNode(TreeNode treeNode) {
      this.left = treeNode;
    }

    public void addRightNode(TreeNode treeNode) {
      this.right = treeNode;
    }
  }
}
